<link href="__PUBLIC__/plugins/fitui/tablegrid.css" rel="stylesheet">
<link href="__PUBLIC__/plugins/bootstrap-datetimepicker/bootstrap-datetimepicker.min.css" rel="stylesheet">
<script src="__PUBLIC__/plugins/bootstrap-datetimepicker/bootstrap-datetimepicker.min.js"></script>
<script src="__PUBLIC__/plugins/bootstrap-datetimepicker/bootstrap-datetimepicker.zh-CN.js"></script>
<script src="__PUBLIC__/js/mp/format.js"></script>
<script src="__PUBLIC__/plugins/fitui/tablegrid.js"></script>
<script src="__PUBLIC__/js/mp/mer_user.js"></script>
<script src="__PUBLIC__/js/mp/area.js"></script>
<script>
var Param = <?php echo json_encode( $param ) ?> ;
$(function(){
  MerUser.init(<?php echo json_encode( $config ) ?>);
  Area.init( <?php echo json_encode($area) ?> );
});

</script>

<div class="page-content">
  <ol class="breadcrumb">
    <li><a href="<?php echo $home_url ?>">首页</a></li>
    <li class="active"> <?php echo $module_name ?></li>
  </ol>
  <div class="page-content-inner"> 
    <!-- read_modal -->
    <div class="portlet blue" id="read_modal"> 
      <!-- portlet-title -->
      <div class="portlet-title">
        <div class="caption"> 
          <i class="fa fa-users "></i> <?php echo $module_name ?> 
        </div>
        <div class="tools"> 
          <a href="#" class="toolbtn add load_add_modal_btn" data-toggle="tooltip" data-placement="top" title="新增"></a> 
        </div>
      </div>
      <!-- end portlet-title -->
      <div class="portlet-body ">

        <form class="form-inline" style="margin-bottom:16px;">
          <div class="form-group">
            <label for="keyword">关键字</label>
            <input type="text" class="form-control" id="keyword" placeholder="关键字">
          </div>
          <button id="search_btn" type="submit" class="btn btn-primary"><i class="fa fa-search"></i> 查询</button>
        </form>

        <!-- table grid -->
        <div class="table-responsive">
          <table id="data_table" class="table table-striped table-hover table-condensed">
            <thead>
              <tr>
                <th width="80" data-field="id" data-sortable="true" >ID</th>
                <th width="80" data-field="headimgurl" data-formatter="format_headimg">头像</th>
                <th width="180" data-field="nickname" >微信昵称</th>
                <th width="80" data-field="points" >积分</th>
                <th width="80" data-field="subscribe" data-formatter="format_subscribe">关注微信</th>
                <th width="80" data-field="wx_qrcode" data-formatter="format_wx_qrcode">推广二维码</th>
                <th width="80" data-field="promote_num" data-formatter="format_promote_num">推广人数</th>
                <th width="60" data-field="status" data-formatter="format_status">状态</th> 
                <th width="140" data-field="create_time" data-formatter="format_datetime">注册时间</th>
                
                <?php if ( $opt_data == 1 || in_array( '编辑' , $opt_data ) ) : ?><th width="80" data-formatter="opt_edit"></th><?php endif ; ?>
                <!--
                <?php if ( $opt_data == 1 || in_array( '删除' , $opt_data ) ) : ?><th width="80" data-formatter="opt_delete"></th><?php endif ; ?>
                -->
                <th width="80" data-formatter="opt_more"></th>
                <th>&nbsp;</th>
              </tr>
            </thead>
          </table>
        </div>
        <!-- end table --> 
        <div class="row" style="text-align:center; margin-top:60px;">
          <button type="button" class="btn btn-lg btn-default" onClick="javascript:history.go(-1)"><i class="fa fa-arrow-left"></i> 返回</button>
        </div>
      </div>
    </div>
    <!-- end portlet read_modal --> 
    
    <!-- add_edit_modal  -->
    <div class="portlet" id="add_edit_modal" style="display:none;">
      <div class="portlet-title">
        <div class="caption"> <i class="fa fa-cogs"></i> <span id="action_label"></span> <?php echo $module_name ?> </div>
      </div>
      <div class="portlet-body ">
        <form id="submit_form" class="form-horizontal">
          <div class="form-group">
            <label class="col-sm-3 control-label">用户名</label>
            <div class="col-sm-7">
              <input name="username" placeholder="用户名" data-valid="required" data-tips="请填写正确的用户名" type="text" class="form-control" >
            </div>
          </div>
          <div class="form-group">
            <label class="col-sm-3 control-label">密码</label>
            <div class="col-sm-7">
              <input name="password" placeholder="密码" type="password" class="form-control" >
            </div>
          </div>
          <div class="form-group">
            <label class="col-sm-3 control-label">手机</label>
            <div class="col-sm-3">
              <input name="phone" placeholder="手机" type="text" class="form-control" >
            </div>
            <div class="col-sm-3">
              <?php echo form_radios('phone_verified' , array('0'=> '未验证' , '1' => '已验证') ) ?>
            </div>
          </div>
          <div class="form-group">
            <label class="col-sm-3 control-label">邮箱</label>
            <div class="col-sm-3">
              <input name="email" placeholder="邮箱" type="text" class="form-control" >
            </div>
            <div class="col-sm-3">
              <?php echo form_radios('email_verified' , array('0'=> '未验证' , '1' => '已验证') ) ?>
            </div>
          </div>
          <div class="form-group">
            <label class="col-sm-3 control-label">邮箱</label>
            <div class="col-sm-7">
              <input name="email" placeholder="邮箱" type="text" class="form-control" >
            </div>
          </div>
          <div class="form-group">
            <label class="col-sm-3 control-label">区域</label>
            <div class="col-sm-7">
              <div class="row">
                <div class="col-sm-4">
                  <select id="province" class="form-control"></select>
                </div>
                <div class="col-sm-4">
                  <select id="city" class="form-control"></select>
                </div>
                <div class="col-sm-4">
                  <select id="district" name="area" class="form-control"></select>
                </div>
              </div>
            </div>
          </div>
          <div class="form-group">
            <label class="col-sm-3 control-label">状态</label>
            <div class="col-sm-7">
              <?php echo form_radios('status' , $param['status']) ?>
            </div>
          </div>
          <div class="form-group">
            <label class="col-sm-3 control-label">注册时间</label>
            <div class="col-sm-7">
              <input name="create_date" placeholder="注册时间" type="text" class="form-control dtp" >
            </div>
          </div>
          <div class="form-group">
            <label class="col-sm-3 control-label">积分</label>
            <div class="col-sm-7">
              <input name="points" placeholder="积分" data-valid="number" data-tips="请填写正确的积分" type="text" class="form-control" >
            </div>
          </div>
          <hr>
          <div class="row">
            <div class="col-md-12" style="text-align:center">
              <button class="btn btn-default btn-lg " id="add_edit_close_btn" type="button"><i class="fa fa-arrow-left"></i> 返回</button>
              <button class="btn btn-danger btn-lg " id="submit_btn" type="button"><i class="fa fa-edit"></i> 提交</button>
            </div>
          </div>
        </form>
      </div>
    </div>
    <!-- end portlet add_edit_modal --> 
    
  </div>
  <!-- end page-content-inner --> 
</div>

<!-- add_edit_model -->
<div class="modal fade" id="provider_modal">
  <div class="modal-dialog">
    <div class="modal-content">
      <div class="modal-header">
        <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
        <h4 class="modal-title">绑定的第三方账户</h4>
      </div>
      <div class="modal-body">
        <form class="form-horizontal">
          <div class="form-group">
            <label class="col-sm-3 control-label">第三方提供商</label>
            <div class="col-sm-7">
              <p class="form-control-static" id="provider"></p>
            </div>
          </div>
          <div class="form-group">
            <label class="col-sm-3 control-label">Openid</label>
            <div class="col-sm-7">
              <p class="form-control-static" id="openid"></p>
            </div>
          </div>
          <div class="form-group">
            <label class="col-sm-3 control-label">绑定时间</label>
            <div class="col-sm-7">
              <p class="form-control-static" id="bind_time"></p>
            </div>
          </div>
          <div class="form-group wx_line" >
            <label class="col-sm-3 control-label">微信公众号</label>
            <div class="col-sm-7">
              <p class="form-control-static" id="wx_name"></p>
            </div>
          </div>
          <div class="form-group wx_line">
            <label class="col-sm-3 control-label">微信推广二维码</label>
            <div class="col-sm-7">
              <img id="wx_qrcode" src="" style="max-width:120px" >
              <button id="create_wx_qrcode_btn" type="button" class="btn btn-primary"><i class="fa fa-qrcode"></i> 创建微信推广二维码</button>
            </div>
          </div> 
        </form>
      </div>
      <div class="modal-footer">
        <button type="button" class="btn btn-default" data-dismiss="modal"><i class="fa fa-times"></i> 关闭</button>
      </div>
    </div>
    <!-- /.modal-content --> 
  </div>
  <!-- /.modal-dialog --> 
</div>
<!-- /#add_edit_model --> 